
 <!DOCTYPE HTML>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  
    <title>Jark&#39;s Blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="WuChong">
    
    <meta name="description" content="伍翀的个人技术博客">
    
    
    <meta name="description" content="伍翀的个人技术博客">
<meta property="og:type" content="website">
<meta property="og:title" content="Jark's Blog">
<meta property="og:url" content="http://wuchong.me/page/7/">
<meta property="og:site_name" content="Jark's Blog">
<meta property="og:description" content="伍翀的个人技术博客">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Jark's Blog">
<meta name="twitter:description" content="伍翀的个人技术博客">
<meta name="twitter:creator" content="@jarkwu">
<link rel="publisher" href="111190881341800841449">

    
    <link rel="alternative" href="/atom.xml" title="Jark&#39;s Blog" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/jacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
    
    <link rel="stylesheet" href="/css/style.css" type="text/css">
</head>

  <body>
    <header>
      <div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="Jark&#39;s Blog" title="Jark&#39;s Blog"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="Jark&#39;s Blog">Jark&#39;s Blog</a></h1>
				<h2 class="blog-motto">当你的才华还撑不起你的野心时，你就应该静下心来学习。</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">首页</a></li>
					
						<li><a href="/archives">归档</a></li>
					
						<li><a href="/about">关于</a></li>
					
					<li>
 					
						<form class="search" action="http://zhannei.baidu.com/cse/search" target="_blank">
							<label>Search</label>
						<input name="s" type="hidden" value= 783281470518440642 ><input type="text" name="q" size="30" placeholder="搜索"><br>
						</form>
					
					</li>
				</ul>
			</nav>			
</div>
    </header>
    <div id="container">
      <div id="main">

   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/01/27/python-spider-gif/" title="Python爬虫：暴走漫画上的GIF趣图" itemprop="url">Python爬虫：暴走漫画上的GIF趣图</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-01-27T15:54:13.000Z" itemprop="datePublished"> 发表于 2014-01-27</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>寒假里有心重新学习Python，本科小学期有用Python写过一个web应用，但忘的差不多了。现在想系统地学习Python，所以把<a href="http://book.douban.com/subject/10561367/" target="_blank" rel="external">《Head First Python》</a>看完了。HeadFirst的书内容有趣且有实例贯穿，但是知识和技巧都打乱在各个章节中了，看完后对Python还是没有系统地了解。所以现在一边写爬虫一边看<a href="http://woodpecker.org.cn/diveintopython/" target="_blank" rel="external">《Dive into Python》</a>带着学习Python。</p>
<p>实现的第一个爬虫是抓取<a href="http://baozoumanhua.com/" target="_blank" rel="external">暴走漫画</a>上的GIF趣图，方便离线观看。爬虫用的是<code>python3.3</code>开发的，主要用到了<code>urllib.request</code>和<code>BeautifulSoup</code>模块。</p>
<p><em>注：<a href="http://www.crummy.com/software/BeautifulSoup/" target="_blank" rel="external">BeautifulSoup</a>是第三方库，我使用的是<code>bs4</code>。<code>urllib2</code>在python3中被分配到了<code>urllib.request</code>中，文档中的原文如下。</em></p>
<blockquote>
<p><strong>Note:</strong>The <code>urllib2</code> module has been split across several modules in Python 3 named <code>urllib.request</code> and <code>urllib.error</code>.</p>
</blockquote>
<p>爬虫<a href="https://gist.github.com/wuchong/8651764" target="_blank" rel="external">源代码</a>如下：<br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/01/27/python-spider-gif/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/Python/">Python</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/Python/">Python</a><a href="/tags/爬虫/">爬虫</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/01/27/python-spider-gif/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/01/27/python-spider-gif/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/01/24/change-to-pacman/" title="折腾了个Pacman主题" itemprop="url">折腾了个Pacman主题</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-01-24T08:21:55.000Z" itemprop="datePublished"> 发表于 2014-01-24</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>更换主题确实是一个非常耗体力的活，但是自从看到了<a href="http://yangjian.me/workspace/introducing-pacman-theme/" target="_blank" rel="external">Pacman</a>主题后，就萌发了换主题的冲动。不过Pacman的第一版主题用起来有很大问题，而且从半年前就不更新了。放弃之后也找遍所有可用主题，都不如所愿。所幸的是，就在上个星期，发现pacman开始更新了，所有的css也都采用<a href="http://learnboost.github.io/stylus/" target="_blank" rel="external">Stylus</a>重写了（原来作者闭关半年在憋大招啊）。遂下载之，发现用起来非常方便。</p>
<h2 id="主题介绍">主题介绍</h2>
<p>扯了这么多，无非就是说这主题多么多么屌。确实，Pacman是一款为<a href="http://zespia.tw/hexo/" target="_blank" rel="external">Hexo</a>打造的一款扁平化，有着响应式设计的主题。在Chrome，Firefox，Sarifa，iOS和Android上都表现非常完美。而我以前的主题一到手机端就长残了，不说了… 至于Pacman主题在IE端会看到意想不到的景象我是不会告诉你们的。还是那句话「珍爱前端程序员生命，请远离IE」。</p>
<p>而且，基于模块化的思想，所有的组件都成了可配置的了，如果你不像我有「审美洁癖」的话，只需要配置主题目录下的<code>_config.yml</code>文件，添加对应组件的账号或ID即可。</p>
<p>而我在使用pacman的过程中，主要修改了文章的样式，code的样式，主题颜色，组件的排版，在一些地方使用了font来显示矢量图标等等。对于改过之后的主题，看官请轻拍，所谓「萝卜青菜，各有所爱」嘛。</p>
<h2 id="主题截图">主题截图</h2>
<p>上几张iPhone端的博客截图。<br><img src="/img/20140124-1.jpg" alt=""></p>

        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/01/24/change-to-pacman/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/Hexo/">Hexo</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/Hexo/">Hexo</a><a href="/tags/博客/">博客</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/01/24/change-to-pacman/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/01/24/change-to-pacman/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/01/17/use-github-to-manage-hexo-source/" title="使用GitHub来管理博客源文件" itemprop="url">使用GitHub来管理博客源文件</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-01-17T15:55:58.000Z" itemprop="datePublished"> 发表于 2014-01-17</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>使用hexo写博客的一个问题就是源文件都是在本地的，如果换了电脑需要更新博客时就会比较麻烦。正好快要放假回家了，这个问题急需解决。</p>
<p>以前的解决办法是将博客拷到U盘里，但是同步又比较麻烦。使用云盘时每次又提示<code>.git</code>文件不能上传。目前，觉得比较靠谱的办法就是用github来管理了。</p>
<p>hexo如果用git文件托管的话，一般在<code>.deploy</code>文件夹下会有个<code>.git</code>文件夹。现在我们在根目录下也弄个<code>.git</code>文件夹就可以了，并且两者可以很和谐地相处。<br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/01/17/use-github-to-manage-hexo-source/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/Hexo/">Hexo</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/Hexo/">Hexo</a><a href="/tags/博客/">博客</a><a href="/tags/GitHub/">GitHub</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/01/17/use-github-to-manage-hexo-source/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/01/17/use-github-to-manage-hexo-source/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/01/08/hexo-scrollup/" title="Hexo博客优化：添加返回顶部功能" itemprop="url">Hexo博客优化：添加返回顶部功能</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-01-08T00:14:45.000Z" itemprop="datePublished"> 发表于 2014-01-08</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>由于自己平时喜欢刷微博，在刷到底部时习惯点下<code>返回顶部</code>的按钮，方便回到顶部导航栏。而看自己博客时，没有这个功能，总感觉很别扭，遂实现了一个。</p>
<p>其实在hexo中实现返回顶部相当简单，所有的东西都是模块化的。只要我们写好HTML文件、JS文件，放入相应的目录，然后在对应的网页位置引用就可以了 。这里分享我的代码和实现过程。<br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/01/08/hexo-scrollup/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/Hexo/">Hexo</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/Hexo/">Hexo</a><a href="/tags/教程/">教程</a><a href="/tags/博客/">博客</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/01/08/hexo-scrollup/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/01/08/hexo-scrollup/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/01/01/2013_summary/" title="2013年终总结" itemprop="url">2013年终总结</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-01-01T10:18:52.000Z" itemprop="datePublished"> 发表于 2014-01-01</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>今天，已经是2014年的第一天了。据说这次跨年有特别的意义，因为那个人是陪你走过13与14的。所以，昨晚与Miss.Y去了“北京之光”跨年。当身边响起54321的倒数声时，以为是闹着玩，当反应过来时我已经踏入了2014。  </p>
<p>回想2013，2013对于我来说是变化最大的一年，对很多东西的看法有很多改变。一直想写一篇这一年的总结，却不知从何说起。过完2013年的最后一天，还是提笔将这一年流水账似的过一遍吧。想到什么写什么，各位看官讲究着看吧 ~<br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/01/01/2013_summary/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/随笔生活/">随笔生活</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/生活/">生活</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/01/01/2013_summary/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/01/01/2013_summary/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>







  <nav id="page-nav" class="clearfix">
    <a class="extend prev" rel="prev" href="/page/6/"><span></span>Prev</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><a class="page-number" href="/page/6/">6</a><span class="page-number current">7</span><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/8/">Next<span></span></a>
  </nav>

</div>
      <div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
<aside class="clearfix">

  
<div class="categorieslist">
	<p class="asidetitle">分类</p>
		<ul>
		
			<li><a href="/categories/Hexo/" title="Hexo">Hexo<sup>7</sup></a></li>
		
			<li><a href="/categories/LinuxUnix/" title="Linux/Unix">Linux/Unix<sup>6</sup></a></li>
		
			<li><a href="/categories/Python/" title="Python">Python<sup>3</sup></a></li>
		
			<li><a href="/categories/推荐系统/" title="推荐系统">推荐系统<sup>3</sup></a></li>
		
			<li><a href="/categories/杂项资源/" title="杂项资源">杂项资源<sup>2</sup></a></li>
		
			<li><a href="/categories/程序设计/" title="程序设计">程序设计<sup>5</sup></a></li>
		
			<li><a href="/categories/系统架构/" title="系统架构">系统架构<sup>1</sup></a></li>
		
			<li><a href="/categories/编程语言/" title="编程语言">编程语言<sup>2</sup></a></li>
		
			<li><a href="/categories/职场生涯/" title="职场生涯">职场生涯<sup>2</sup></a></li>
		
			<li><a href="/categories/随笔生活/" title="随笔生活">随笔生活<sup>5</sup></a></li>
		
		</ul>
</div>


  
<div class="tagslist">
	<p class="asidetitle">标签</p>
		<ul class="clearfix">
		
			<li><a href="/tags/Hexo/" title="Hexo">Hexo<sup>8</sup></a></li>
		
			<li><a href="/tags/面试/" title="面试">面试<sup>5</sup></a></li>
		
			<li><a href="/tags/Linux基础/" title="Linux基础">Linux基础<sup>5</sup></a></li>
		
			<li><a href="/tags/生活/" title="生活">生活<sup>4</sup></a></li>
		
			<li><a href="/tags/博客/" title="博客">博客<sup>4</sup></a></li>
		
			<li><a href="/tags/Python/" title="Python">Python<sup>4</sup></a></li>
		
			<li><a href="/tags/阿里推荐大赛/" title="阿里推荐大赛">阿里推荐大赛<sup>4</sup></a></li>
		
			<li><a href="/tags/算法/" title="算法">算法<sup>2</sup></a></li>
		
			<li><a href="/tags/爬虫/" title="爬虫">爬虫<sup>2</sup></a></li>
		
			<li><a href="/tags/ODPS/" title="ODPS">ODPS<sup>2</sup></a></li>
		
			<li><a href="/tags/教程/" title="教程">教程<sup>2</sup></a></li>
		
			<li><a href="/tags/Jacman/" title="Jacman">Jacman<sup>2</sup></a></li>
		
			<li><a href="/tags/Java/" title="Java">Java<sup>2</sup></a></li>
		
			<li><a href="/tags/文件系统/" title="文件系统">文件系统<sup>2</sup></a></li>
		
			<li><a href="/tags/启动流程/" title="启动流程">启动流程<sup>1</sup></a></li>
		
			<li><a href="/tags/权限/" title="权限">权限<sup>1</sup></a></li>
		
			<li><a href="/tags/正则表达式/" title="正则表达式">正则表达式<sup>1</sup></a></li>
		
			<li><a href="/tags/jQuery/" title="jQuery">jQuery<sup>1</sup></a></li>
		
			<li><a href="/tags/双检锁/" title="双检锁">双检锁<sup>1</sup></a></li>
		
			<li><a href="/tags/设计模式/" title="设计模式">设计模式<sup>1</sup></a></li>
		
		</ul>
</div>


  <div class="linkslist">
  <p class="asidetitle">友情链接</p>
    <ul>
        
          <li>
            <a href="https://coderq.com" target="_blank" title="码农圈">码农圈</a>
          </li>
        
          <li>
            <a href="http://zipperary.com/" target="_blank" title="Zippera&#39;s Blog">Zippera&#39;s Blog</a>
          </li>
        
          <li>
            <a href="http://hijiangtao.github.io/" target="_blank" title="Data.Blog">Data.Blog</a>
          </li>
        
    </ul>
</div>

  <div class="weiboshow">
  <p class="asidetitle">新浪微博</p>
    <iframe width="100%" height="119" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=119&fansRow=2&ptype=1&speed=0&skin=9&isTitle=1&noborder=1&isWeibo=0&isFans=0&uid=2176287895&verifier=b3593ceb&dpc=1"></iframe>
</div>


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS 订阅</a>
</div>

</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> Hello,I&#39;m WuChong. For now I&#39;m a graduate student in Beijing. <br/>
			I&#39;ll share my learning experience with you at this blog.</p>
	</section>
	 
	<div class="social-font" class="clearfix">
		
		<a href="http://weibo.com/wuchong1014" target="_blank" class="icon-weibo" title="微博"></a>
		
		
		<a href="https://github.com/wuchong" target="_blank" class="icon-github" title="github"></a>
		
		
		
		<a href="https://twitter.com/jarkwu" target="_blank" class="icon-twitter" title="twitter"></a>
		
		
		
		
		
		
		<a href="https://plus.google.com/111190881341800841449?rel=author" target="_blank" class="icon-google_plus" title="Google+"></a>
		
		
	</div>
		<p class="copyright">Powered by <a href="http://zespia.tw/hexo/" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Pacman">Jacman</a> © 2014 
		
		<a href="http://wuchong.me/about" target="_blank" title="WuChong">WuChong</a>
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else
    {
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
        
    }
  });
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
});
</script>




<script type="text/javascript">
  var duoshuoQuery = {short_name:"wuchong"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
    || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 









<!-- Analytics Begin -->

<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46321946-2', 'wuchong.me');  
ga('send', 'pageview');
</script>





<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="返回顶部"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

  </body>
 </html>
